#ifndef STUDENT_PUB_H
#define STUDENT_PUB_H

#define MAX_STUDENTS 1000
#define MAX_COURSES_PER_STUDENT 10
#define MAX_NAME_LEN 50
#define MAX_ID_LEN 20

typedef struct {
    char id[MAX_ID_LEN];                    // 学号
    char name[MAX_NAME_LEN];                // 姓名
    char courses[MAX_COURSES_PER_STUDENT][MAX_ID_LEN]; // 已选课程列表
    int course_count;                       // 已选课程数量
    float total_credits;                    // 总学分
} Student;

// 学生管理函数声明
void init_student_manager();
int add_student(const char* id, const char* name);
int delete_student(const char* id);
Student* find_student_by_id(const char* id);
Student* find_student_by_name(const char* name);
int update_student_info(const char* id, const char* new_name);
int select_course_for_student(const char* student_id, const char* course_id);
int drop_course_for_student(const char* student_id, const char* course_id);
void list_all_students();
int get_student_count();
Student* get_all_students();

#endif
